const $http = (options) => {
	const {
		url,
		data
	} = options
	return new Promise((reslove, reject) => {
		uniCloud.callFunction({
			name: url,
			data:data,
		}).then((backdata) => {
			const {
				status
			} = backdata.result
			if (status === 200) {
				reslove(backdata.result)
			} else {
				reject(backdata.result)
			}
		}).catch((err)=>{
			reject(err)
		})
	})

}

export default $http

